package com.example.yiwei.crm.view.frament.clueDetailedMenu;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.yiwei.crm.R;
import com.example.yiwei.crm.data.GetClue;
import com.example.yiwei.crm.entity.ClueMeesageEntity;

/**
 * Created by Administrator on 2017/1/12.
 */

public class clueBaseFragment extends Fragment {
    TextView txt_name,txt_age,txt_gender,txt_position,txt_company_name,txt_manager;
    ClueMeesageEntity clue;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootview=inflater.inflate(R.layout.fragment_clue_base,container,false);
        txt_manager= (TextView) rootview.findViewById(R.id.fram_clue_base_manager);
        txt_name= (TextView) rootview.findViewById(R.id.fragment_clue_base_name);
        txt_age= (TextView) rootview.findViewById(R.id.fram_clue_base_age);
        txt_gender= (TextView) rootview.findViewById(R.id.fragment_clue_base_gender);
        txt_company_name= (TextView) rootview.findViewById(R.id.fragment_clue_base_company_name);
        txt_position= (TextView) rootview.findViewById(R.id.fragment_clue_base_position);
        clue= GetClue.get();
        if (String.valueOf(clue.getClue_manager())!=null){
            if (clue.getClue_manager()==0) {
                txt_manager.setText("无");
            }else{
                txt_manager.setText(clue.getClue_manager_name());
            }
        }
        txt_name.setText(clue.getClue_name());
        if (clue.getClue_gender()==1){
            txt_gender.setText("男");
        }else if (clue.getClue_gender()==2){
            txt_gender.setText("女");
        }else {
            txt_gender.setText("性别填写错误");
        }
        txt_age.setText(clue.getClue_age()+"");
        return rootview;
    }
}
